package cn.edu.fzu.homemaking.sso.mapper;

import java.util.List;

import cn.edu.fzu.homemaking.sso.domain.entity.Role;
import cn.edu.fzu.homemaking.sso.domain.enums.StatusEnum;
import org.apache.ibatis.annotations.Param;

public interface RoleMapper {

    List<Role> list(@Param("name") String name, @Param("status") StatusEnum status);


    Role getById(@Param("id") Long id);


    void insert(@Param("name") String name, @Param("description") String description,
                @Param("status") StatusEnum status, @Param("companyId") Long companyId);


    void update(@Param("id") Long id, @Param("description") String description, @Param("status") StatusEnum status);


    void delete(@Param("id") Long id);


    void deleteUserRoleByUserId(@Param("userId") Long userId);


    void addUserRole(@Param("userId") Long userId, @Param("roleIds") List<Long> roleIds);


    List<Long> listRoleIdByUserId(@Param("userId") Long userId);


    List<Long> listUserIdByRoleId(@Param("roleId") Long roleId);


    List<Role> listRoleByUserId(@Param("userId") Long userId);
}
